#include <iostream>
#include <opencv2/opencv.hpp>

void show(cv::Mat &mat, const std::string &win_name)
{
    cv::imshow(win_name, mat);
    std::cout << "show image: " << win_name << std::endl;
    cv::waitKey(0);
}

int main()
{
    cv::Mat mat_rgb = cv::imread("gogh.jpg", CV_LOAD_IMAGE_UNCHANGED);
    cv::Mat mat_gray = cv::imread("gogh.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    cv::Mat mat_int16, mat_float32;

    mat_gray.convertTo(mat_int16, CV_16U, 255);
    mat_gray.convertTo(mat_float32, CV_32F, 1/255.0);

    show(mat_rgb, "rgb");
    show(mat_gray, "gray");
    show(mat_int16, "int16");
    show(mat_float32, "float32");

    return 0;
}